package com.centaur0.springmvc;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.centaur0.model.Usuario;
import com.centaur0.util.Application;

public class LoginInterceptor extends HandlerInterceptorAdapter {
	
	@Override
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {
		return ((Usuario)Application.getResource(Application.USER_HTTP_SESSION)).isAutenticado();
	}
}
